import requests


class TpLogin:

    def tp_login(self,logindata):
        session=requests.Session()
        session.get(url='http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=verify&r=0.0001028215650840103')
        response=session.post(url='http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=do_login&t=0.05770042813538456'
                              ,json=logindata)
        print(response.json())
        return response

if __name__ == '__main__':
    TpLogin().tp_login( {
      "username": None,
    "password": "123456",
    "verify_code": "8888"})

    # {'status': 1, 'msg': '登陆成功', 'result': {'user_id': 4576, 'email': '',
    #                                         'password': '519475228fe35ad067744465c42a19b2',
    #                                         'paypwd': None, 'sex': 0, 'birthday': 0,
    #                                         'withdrawal_total_money': '0.00',
    #                                         'user_total_money': '0.00',
    #                                         'user_money': '0.00',
    #                                         'frozen_money': '0.00',
    #                                         'distribut_money': '0.00',
    #                                         'distribut_withdrawals_money': '0.00',
    #                                         'underling_number': 0, 'pay_points': 100,
    #                                         'reg_time': 1669454745,
    #                                         'last_login': 1669454745, 'last_ip': '',
    #                                         'qq': '', 'mobile': '13800000002',
    #                                         'mobile_validated': 1, 'oauth': '',
    #                                         'openid': None, 'unionid': None,
    #                                         'head_pic': '/public/images/icon_goods_thumb_empty_300.png',
    #                                         'province': 0, 'city': 0, 'district': 0,
    #                                         'email_validated': 0,
    #                                         'nickname': '13800000002', 'level': 1,
    #                                         'discount': '1.00',
    #                                         'total_amount': '0.00', 'is_lock': 0,
    #                                         'is_distribut': 1, 'first_leader': 0,
    #                                         'second_leader': 0, 'third_leader': 0,
    #                                         'token': '00364db059f4758799979c7512504d73',
    #                                         'message_mask': 63, 'push_id': '0',
    #                                         'distribut_level': 0, 'is_vip': 0,
    #                                         'xcx_qrcode': None, 'poster': None,
    #                                         'level_name': None}, 'url': ''}
